"""p9_exe URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from rest_framework.routers import DefaultRouter
from .views import *
router = DefaultRouter()
# 查询所有菜品
router.register("disclas", DishesClassifyViewSet),
# 加载所有类别
router.register("categories", ListCateAPIView),
# 展示所有商家
router.register("shopss", Shops),
# 修改商品信息
router.register("upgood",UpGoodView),

urlpatterns = [
    # # 加载所有菜品类别
    # path("categories/",ListCateAPIView.as_view()),
    # 商家申请
    path('register/', ShopsView.as_view({"post": "shop_register"})),
    # 获取商家用户信息
    path('shops/', ShopsView.as_view({"get": "shops_dict"})),
    #根据商家获取菜品
    path("disclass/<int:id>/", DishesAPIView.as_view()),
    #根据种类获取菜品
    path("casse/<int:id>/", CaseAPIView.as_view()),
    #商家登录
    path("logins/",ShopsView.as_view({"post":"logins"})),
    #商家订单
    path("order_shop/",Shop_order.as_view({"get":"shop_order"})),
    # 获取订单详情
    path('order_desc/<int:pk>/', Shop_order.as_view({"get":"order_desc"})),


]


urlpatterns += router.urls
